package gui.jmenubar.jmenu;

import gui.jtab.estambre.JTabObjectEstambre;

import java.awt.event.MouseEvent;

import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JSeparator;

public class JMenuEstambre extends JMenuApp{

	private static final long serialVersionUID = 1L;
	
	public JMenuEstambre(){
		initComponents();
	}

	private void initComponents() {
		setText("Estambre");	
		
		JMenuItem jMenuItem = new JMenuItem();
		jMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
				java.awt.event.KeyEvent.VK_P,
				java.awt.event.InputEvent.CTRL_MASK));
		jMenuItem.setText("Perfila");
		jMenuItem.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mousePressed(java.awt.event.MouseEvent evt) {
				jMenuItemPerfilaMouseClicked(evt);
			}

			private void jMenuItemPerfilaMouseClicked(MouseEvent evt) {
				((JTabObjectEstambre)jTab).perfila();
			}
		});
		add(jMenuItem);

		add(new JSeparator());

		JMenu submenu = new JMenu("Color");
		submenu.setMnemonic(java.awt.event.KeyEvent.VK_C);
		add(submenu);

		jMenuItem = new JMenuItem();
		jMenuItem.setText("Color Base");
		jMenuItem
				.addMouseListener(new java.awt.event.MouseAdapter() {
					public void mousePressed(java.awt.event.MouseEvent evt) {
						jMenuItemColorBaseMouseClicked(evt);
					}

					private void jMenuItemColorBaseMouseClicked(MouseEvent evt) {
						((JTabObjectEstambre)jTab).setColorBase();
					}
				});		
		submenu.add(jMenuItem);
		
		jMenuItem = new JMenuItem();
		jMenuItem.setText("Color cabeza");
		jMenuItem
				.addMouseListener(new java.awt.event.MouseAdapter() {
					public void mousePressed(java.awt.event.MouseEvent evt) {
						jMenuItemColorCabezaMouseClicked(evt);
					}

					private void jMenuItemColorCabezaMouseClicked(MouseEvent evt) {
						((JTabObjectEstambre)jTab).setColorCabeza();
					}
				});
		submenu.add(jMenuItem);		
	}	
}

